package org.xtremeobjects.anotations.state;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Represents a transition of a State Machine
 * The method anotated is a transition trigger for
 * the state machine transition.
 * If this method is called on an invalid State will throw
 * InvalidStateException.
 * @see StateMachine
 * @author Juan
 */
@Retention(value=RetentionPolicy.RUNTIME)
@Target(value=ElementType.PARAMETER)
public @interface Transition {

	/**
	 * Name of transition, always optional, just needed
	 * in case of use an @OnTransition annotation.
	 * @return
	 */
	String name() default("");

	/**
	 * State name from where will transition.
	 * It defaults to Any state.
	 * @return
	 */
	String[] from() default("Any");

	/**
	 * State name to where will transition.
	 * @return
	 */
	String to();

	/**
	 * To what state machine this belongs.
	 * @return
	 */
	String statemachine() default("Default");

	/**
	 * Transition guard expression (OCL)
	 * @return
	 */
	String guard() default("");

	/**
	 * Transition guard description
	 * @return
	 */
	String guardDescr() default("");
}
